//
//  HelloWorldLayer.m
//  Open RPG
//
//  Created by Bryan Monsalvatge on 2/6/11.
//  Copyright __MyCompanyName__ 2011. All rights reserved.
//

// Import the interfaces
#import "StartMenu.h"
#import "Level1.h"
// HelloWorld implementation
@implementation StartMenu

+(id) scene
{
	// 'scene' is an autorelease object.
	CCScene *scene = [CCScene node];
	
	// 'layer' is an autorelease object.
	StartMenu *layer = [StartMenu node];
	
	// add layer as a child to scene
	[scene addChild: layer];
	
	// return the scene
	return scene;
}

// on "init" you need to initialize your instance
-(id) init
{
	// always call "super" init
	// Apple recommends to re-assign "self" with the "super" return value
	if( (self=[super init] )) {
		
		// create and initialize a Label
		//CCLabelTTF *label = [CCLabelTTF labelWithString:@"Hello World" fontName:@"Marker Felt" fontSize:64];
		CCMenuItemImage *Start = [CCMenuItemImage itemFromNormalImage:@"Start Game.png" selectedImage:@"Start Game.png"
															   target:self selector:@selector(StartAction:)];
		
		CCMenu *Menu = [CCMenu menuWithItems:Start, nil];
		
		[self addChild: Menu];
	}
	return self;
}

-(void)StartAction:(id)sender{

	[[CCDirector sharedDirector]replaceScene:[CCTransitionZoomFlipX transitionWithDuration:1 scene:[Level1 node]]];

}

// on "dealloc" you need to release all your retained objects
- (void) dealloc
{
	// in case you have something to dealloc, do it in this method
	// in this particular example nothing needs to be released.
	// cocos2d will automatically release all the children (Label)
	
	// don't forget to call "super dealloc"
	[super dealloc];
}
@end
